#include "pubfunc.h"
#include "datetime.h"

basic_ostream<char, char_traits<char> >& logtime(basic_ostream<char, char_traits<char> > &o)
{
		char logtime[32];
		Datetime t(time(0));
		
		sprintf(logtime, "%04d-%02d-%02d %02d:%02d:%02d", t.getYear(), t.getMonth(), t.getDay(), 
			t.getHour(), t.getMinute(), t.getSecond());
		
		o<<"["<<logtime<<"]:"<<flush;
}
